using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
#if UNITY_EDITOR
using UnityEditor;
#endif

public class PauseMenu : MonoBehaviour
{
    [SerializeField]private GameObject pauseMenu;
    [SerializeField]private HowToPlayDialog howToPlayDialog;
    [SerializeField]private SettingDialog settingDialog;
    [SerializeField]private Transform canvas;
    [SerializeField] private Button pauseButton;

    private void Start()
    {
        pauseButton.onClick.AddListener(Pause);
    }

    public void Pause()
    {
        pauseMenu.SetActive(true);
    }
    

    public void Resume()
    {
        pauseMenu.SetActive(false);
    }

    public void OpenHowToPlay()
    {
        DialogBase dialog=Instantiate(howToPlayDialog);
        dialog.OpenDialog();
    }
    
    public void OpenSetting()
    {
        DialogBase dialog=Instantiate(settingDialog);
        dialog.OpenDialog();
    }

    public void Quit()
    {
        SceneManager.LoadScene(0);
    }

}
